package EBM.util;

import java.util.*;
import java.io.*;

public class ParseProperties {
	
	private static Properties properties = null;
	private static String filePath = "EBMconfig.properties";

	synchronized public static String getProperties(String propStr){
		if(ParseProperties.properties == null)
			ParseProperties.buildProperties();		
		//return properties.getProperty(propStr);
		String pstr = properties.getProperty(propStr);
		System.out.println(propStr+" = "+pstr);
		return pstr;
	}
	
	private static void buildProperties() {
		try{
			ParseProperties.properties = new Properties();
			InputStream is = new FileInputStream(filePath);
			ParseProperties.properties.load(is);
			is.close();
		}
		catch(Exception ex){
			System.out.println(ex);
		}
	}
}
